home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
023a
/
adrsbar.zip
/
ADRSPRN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-06-28
|
2KB
|
59 lines
(* ADRSPRN was written 6/12/91 by R.B. Shreve, CIS 73757,3523, amateur *)
(* radio call W8GRG, to work with POSTNT by Dave Barrett to read address *)
(* files in ASCII format and print the postal barcode on the fourth line *)
(* of an address label -- it is released to the public domain under the *)
(* same terms and conditions as set forth by Dave for POSTNT with which *)
(* it is combined under the program name ADRSBAR. Address questions or *)
(* comments to LEARA, PO Box 952, Lee Finance Sta., Shaker Hts., OH 44120*)
unit ADRSPRN;
interface
Uses Printer, Dos, CRT;
var
FirstName,
LastName,
Address,
City : String[30];
State : String[2];
Zip : String[10];
procedure GetAdr(var ff:text);
implementation
var
s : string[30];
Adrec : String[100];
i, n,
Count : integer;
function GetField(s:string):string;
begin
i:= pos(',',s); {locates the first comma}
GetField := copy(s,1,i-1); {copies everything before the comma}
delete(adrec,1,i) {deletes the field and comma, so the comma
at the end of the next field is now first}
end;
procedure GetAdr(var ff:text);
begin
FirstName := '';
LastName := '';
Address := '';
City := '';
State := '';
Zip := '';
s:= '';
i:=0;
ReadLn(ff, adrec); {Get a record}
FirstName := GetField(adrec); {Read fields in order}
LastName := GetField(adrec);
Address := GetField(adrec);
City := GetField(adrec);
State := GetField(adrec);
Zip := copy(adrec,1,10); {copy all that remains - there is no
comma after the zipcode}
end;
end.